package com.wiscamp.ninechapters.problems.infrastructure.mappers.statistics;

import com.wiscamp.ninechapters.problems.infrastructure.po.statistics.StatisticsMenteeLevelPO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

@Repository
public interface StatisticsMenteeLevelMapper extends JpaRepository<StatisticsMenteeLevelPO, Long>, JpaSpecificationExecutor<StatisticsMenteeLevelPO> {

    @Query(value = "select e from StatisticsMenteeLevelPO e where e.dateYear = :year and e.dateMonth = :month and e.dateDay = :day and e.userId = :userId and e.difficultyLevel = :level")
    StatisticsMenteeLevelPO findByUserAndLevel(int year, int month, int day, long userId, short level);
}